Skip to content

Conversation

@ivanvs
Copy link

@ivanvs ivanvs commented Dec 3, 2023

Connected to #957 and #129

Add information which topics cannot be deleted when user tries to delete topics.

  1. Add KafkaJSDeleteTopicError that is extending KafkaJSProtocolError
  2. Modify v0 parser for deleteTopics to handle errors better
  3. Modify admin API to deal with new deleteTopics error structure

throw e
}

if ('NOT_CONTROLLER'.includes(e.type)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, this should be e.type === 'NOT_CONTROLLER'.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gfoltz you are totally right. I have changed how error type is checked.

Thank you.

logger.warn('Could not delete topics', { error: e.message, retryCount, retryTime })
if (
e.name === 'KafkaJSAggregateError' &&
e.errors.some(error => error.type.includes('UNKNOWN_TOPIC_OR_PARTITION'))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be error => error.type === 'UNKNOWN_TOPIC_OR_PARTITION'. The use of includes in the original code was on an Array. But here you're using it on a string, which works but I think only accidentally, and I'm pretty sure is not what you intend.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is also changed.

Thank you.

@ivanvs ivanvs closed this by deleting the head repository Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants